<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>	
<%-- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<%-- <c:set var="path" value="${pageContext.request.contextPath }" /> --%>
<%@ include file="twowechat_share_base.jsp"  %>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta http-equiv="Expires" CONTENT="0">
	<meta http-equiv="Cache-Control" CONTENT="no-cache">
	<meta http-equiv="Pragma" CONTENT="no-cache">
	<title>小二保险</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<style>
@charset "utf-8";
/* CSS Document */
*html{background-image:url(about:blank);background-attachment:fixed;}/*解决IE6下滚动抖动的问题*/
/*解决IE6下不兼容 position:fixed 的问题*/
body, div, address, blockquote, iframe, ul, ol, dl, dt, dd, li, dl, h1, h2, h3, h4, h5, h6, p, pre, table, caption, th, td, form, legend, fieldset, input, button, select, textarea {margin:0; padding:0; font-weight:
normal;font-style: normal;font-size: 100%; font-family:"黑体",Arial, Helvetica, sans-serif; -webkit-appearance:none; max-width:640px;}
ol, ul ,li{list-style: none;}
img {border: 0; margin:0; padding:0;}
body {color:#000;font-size:12px; margin:0 auto;cursor:default; width:100%; background:#f6f6f6; -webkit-tap-highlight-color: rgba(0,0,0,0);}
a,em{ font-style:normal; text-decoration:none;}
a{color:#484848;}
a:hover{color:#484848;}
input, button{border:0 none; background:none transparent; margin:0; padding:0;}
.clearfix:after {clear:both; content:"."; display:block; height:0pt; visibility:hidden; overflow:hidden;}
.clear{clear:both; height:0px; margin-top:-1px; width:100%; line-height:0px;} 
.dis{display:block;}
.undis{display:none;}
input[type="button"], input[type="submit"], input[type="reset"], input[type="radio"] {-webkit-appearance: none;}

.wechat{margin:0 auto; width:100%; background: url(../img/top_bj.jpg)  repeat-x; color:#fff;}
.wechat_centent{ margin:0 auto; width:90%; padding-bottom:20px; padding:5% 0;}
.wechat_centent_left{float:left; width:60px; text-align:center; margin-right:10px;}
.wechat_centent_left img{ width:60px; text-align:center; border-radius:100%;height:60px;}
.wechat_centent_right{float: left; width:70%; font-size:14px; line-height:30px;}
.wechat_centent_right p{font-size:16px;}
.wechat_centent_right img{width:20px; vertical-align:sub;}
.wechat_explain{margin:0 auto; width:100%; background:#fff; border-bottom:#e3e3e3 1px solid; margin-top:15px;} 
.wechat_explain_top{margin:0 auto; width:100%; text-align:center; font-size:14px;line-height:40px; color:#8d8b8b;}
.wechat_explain_top img{width:100%;}
.wechat_explain_centent{margin:0 auto; width:90%; padding:2% 5%; line-height:160%; color:#8d8d8d; font-size:14px; }
.wechat_bot{ margin:0 auto; width:74.2%; margin-top:30px; margin-bottom:30px;}
.wechat_bot a{width:100%; line-height:35px; border-radius:5px; background:#0e76d3; font-size:16px; display:block; color:#fff; text-align:center;}
.wechat_bot a:active{background:#004bab;}
.wechat_bot span{width:100%; line-height:35px; border-radius:5px; background:#f61501; font-size:16px; display:block; color:#fff; text-align:center;}
.chenggong{margin:0 auto; width:100%; margin-top:10px; text-align:center;}
.chenggong img{width:43%; display: block; margin-left:28.5%;}
.chenggong p{text-align:center; font-size:16px;}

.myfrom{margin:0 auto; width:100%; background:#fff; margin-top:15px;}
.myfrom ul{float:left; width:100%;}
.myfrom ul li{float:left; width:41.5%; margin-left:8%; padding: 10px 0;}
.myfrom ul li img{width:25%; float:left;}
.myfrom ul li span{float:left; width:67%; padding-left:8%; line-height:130%; color:#9a9a9a; font-size:14px;}
.name{ float:left; width:100%; border-bottom:#e3e3e3 1px solid; line-height:40px;}
.name_left{float:left; width:25%; margin-left:5%; }
.name_right{float:left; width:70%;}
.name_right input{line-height:40px; width:100%;}
.button{width:35% !important; line-height:30px !important; height:30px; border:#f3584a 1px solid; border-radius:50px/50px; -webkit-tap-highlight-color: rgba(0,0,0,0); color:#f3584a; padding:0 5px;}
.myfrom_bot{margin:0 auto; width:90%; color:#9d9d9d; line-height:18px;}
.height1{margin:0 auto; width:100%; height:1px; line-height:1px; background:#eeeeee; clear:both;}
.myfrom img{width:100%;}


#dlDiv{background: url(../img/lcb/zzc.png) repeat;z-index:2;width: 100%;height:100%;left:0%;/*FF IE7*/top:0%;/*FF IE7*/position:fixed!important;/*FF IE7*/position: relative;/*IE6*/_top:expression(eval(document.compatMode &&document.compatMode=='CSS1Compat') ?documentElement.scrollTop + (document.documentElement.clientHeight-this.offsetHeight)/2 :/*IE6*/document.body.scrollTop + (document.body.clientHeight - this.clientHeight)/2);}

.show{margin:0 auto; position:absolute; top:35%; width:70%; background:#fff; left:15%; font-size:130%; border-radius:10px; padding-top:30px; color:#000;}
.show_top{ float:left; width:90%; padding-left:5%; padding-right:5%; padding-bottom:20px; border-bottom:#e1e1e1 1px solid;}
.show_bot{float:left; width:100%;}
.show_bot_left{float:left; width:49.5%; border-right:#e1e1e1 1px solid; text-align:center; line-height:40px;}
.show_bot_left a{color:#000;  width:100%; display:block;}
.show_bot_left a:active{color:#2c2b2b;}
.show_bot_right{float:left; width:49.5%;  text-align:center; line-height:40px;}
.show_bot_right a{color:#000; width:100%; display:block;}
.show_bot_right a:active{color:#16355e;}
.show_bot_centent{float:left; width:100%; text-align:center;line-height:40px; display:block; cursor:pointer;}
.show_bot_centent a{color:#000; width:100%; display:block;}
.show_bot_centent a:active{color:#000;}
.input{border:#f4f4f4 1px solid; width:100%; line-height:35px;}
.bot{ margin:0 auto; width:100%; text-align:center;}
.bot img{width:100%;}



@media (device-height:480px) and (-webkit-min-device-pixel-ratio:2){/* 兼容iphone4/4s */	
.myfrom ul li span{line-height:130%;}
}
@media (device-height:568px) and (-webkit-min-device-pixel-ratio:2){/* 兼容iphone5 */
.myfrom ul li span{line-height:130%;}
}
@media (device-height:667px) and (-webkit-min-device-pixel-ratio:2){/* 兼容iphone6 */
.myfrom ul li span{line-height:150%;}
}	
@media (device-height:736px) and (-webkit-min-device-pixel-ratio:2){/* 兼容iphone6 Plus */
.myfrom ul li span{line-height:150%;}
}
@media (device-height:640px) and (-webkit-min-device-pixel-ratio:2){/* 通用and 640 */
}
</style>
<script>
/**
 * wechat.do 返回 
 * 1、teamSummary 团队信息
 * 2、wechat 二次分享内容
 * 3、uid 
 * 4、teamShareJoinPrepare 对应 authUrl（微信加入地址）,noAuthUrl（普通浏览器加入地址）
 */
var authUrl = '${teamShareJoinPrepare.authUrl}';
var noAuthUrl = '${teamShareJoinPrepare.noAuthUrl}';

/**
 * 加入团队返回该页面
 */
var code='${code}';
var wechatError='${wechatError}';
var joinErrorMessage='${joinErrorMessage}';
window.onload=function(){
	if('joined'=='${teamJoinReturn.joinStatus}'){
		document.getElementById("p").innerHTML="恭喜您加入成功!";
		document.getElementById("chenggong").style.display="block";
		downloading();
	}
	if('prepare'=='${teamJoinReturn.joinStatus}'){
		document.getElementById("myfrom_bot").style.display="none";
		document.getElementById("p").innerHTML="加入${teamJoinReturn.teamName}成功，请下载注册利车宝App！";
		document.getElementById("chenggong").style.display="block";
		downloading();
		
	}
	if(wechatError=='1'){//微信授权错误 录入手机号
		document.getElementById("dlDiv").style.display="block";
	}else if(joinErrorMessage!=undefined&&joinErrorMessage!=''){//如果加入报错弹出错误信息，或者下载
		document.getElementById("p1").innerHTML=joinErrorMessage;
		document.getElementById("myfrom_bot").style.display="none";
		document.getElementById("shibai").style.display="block";
		downloading();
	}
}
function isWeiXin(){
    var ua = window.navigator.userAgent.toLowerCase();
    if(ua.match(/MicroMessenger/i) == 'micromessenger'){
        return true;
    }else{
        return false;
    }
}

function downloading(){
	var ua = navigator.userAgent.toLowerCase();
	if (/iphone|ipad|ipod/.test(ua)) {    
   		document.getElementById("wechat_bot").innerHTML='${F9}';   
	} else if (/android/.test(ua)) {
   		document.getElementById("wechat_bot").innerHTML='${F8}';
	} else {
		var f8 = '${F8}';
		var f9 = '${F9}';
		if(f8!=''&&f9!=''&&f8!=undefined&&f9!=undefined&&f8==f9){
			document.getElementById("wechat_bot").innerHTML='${F8}';
		}else if(f8!=''&&f9!=''&&f8!=undefined&&f9!=undefined&&f8!=f9){
			var innerHTML = "安卓下载地址："+f8+",苹果下载地址："+f9;
			document.getElementById("wechat_bot").innerHTML=innerHTML;
		}else{
			document.getElementById("wechat_bot").innerHTML="请联系运营商管理人员！";
		}
	}
}

function apply_tel(){
	document.getElementById("dlDiv").style.display="block";
	}
function Manual_close(){
	document.getElementById("dlDiv").style.display = "none" ;
}	

function tel(){
	var tel=document.getElementById("tel").value;
	if(tel==""||tel=="undefined"){
			document.getElementById("show_top_span").style.color="#ff0000";
			document.getElementById("show_top_span").innerHTML="请输入您的电话！";
			setInterval("document.getElementById('show_top_span').style.color='#000000';document.getElementById('show_top_span').innerHTML='请输入您的手机号！';",3000);
	}else{
		//noAuthUrl;//请求我要加入
		var form=$("<form id='teamShare'>");//定义一个form表单
		    form.attr("style","display:none");
		    form.attr("target","");
		    form.attr("method","post");
		    form.attr("action",noAuthUrl);
		    var input1=$("<input type='hidden' name='telephone' value='"+tel+"'>");
		    
		    $("body").append(form);//将表单放置在web中
		    form.append(input1);
		    form.submit();//表单提交 
	}
}

function apply(){
	var condition = '${teamShareJoinPrepare.condition}';
	if(condition=='telephone'){
		document.getElementById("dlDiv").style.display="block";
	} else {
		if(isWeiXin()&&wechatError!='1'){
			location.href=authUrl;
		}else{
			document.getElementById("dlDiv").style.display="block";
		}
	}
}	
</script>
</head>
<body class="easyui-layout"  style="overflow-y: hidden"  scroll="no">
<div class="wechat">
    <div class="wechat_centent">
    	<div class="wechat_centent_left"><img src="${teamSummary.teamPhoto}"></div>
        <div class="wechat_centent_right"><p>微信昵称</p><img src="${pageContext.request.contextPath}/img/lcb/dp.png">${teamSummary.showName} <img src="${pageContext.request.contextPath}/img/lcb/dw.png">${teamSummary.regionSummary.cityName}</div>
        <div class="clear"></div>
    </div>
    <div class="clear"></div>
</div>

<div class="wechat_explain">
	<div class="wechat_explain_top"><img src="${pageContext.request.contextPath}/img/lcb/fx_top.png"></div>
    <div class="wechat_explain_centent">
    	内容
    </div>
</div>
<div class="clear"></div>
<div class="myfrom" id="myfrom_bot">
	<ul>
    	<li style="border-right:#eeeeee 1px solid;"><img src="${pageContext.request.contextPath}/img/lcb/centent_1.png"><span>随时随地出单<br>坐等保单</span></li>
        <li><img src="${pageContext.request.contextPath}/img/lcb/centent_2.png"><span>精准报价<br>车型丰富</span></li>
        <div class="height1"></div>
        <li style="border-right:#eeeeee 1px solid;"><img src="${pageContext.request.contextPath}/img/lcb/centent_3.png"><span>收益高<br>即时到账</span></li>
        <li><img src="${pageContext.request.contextPath}/img/lcb/centent_4.png"><span>0门槛建团<br>长享管理费</span></li>
        <div class="height1"></div>
    </ul>	
    <div class="clear"></div>
</div>
<div class="clear"></div>
<div class="chenggong" id="chenggong" style="display:none;"><img src="${pageContext.request.contextPath}/img/lcb/chenggong.jpg"><p id="p"></p></div>
<div class="chenggong" id="shibai" style="display:none;"><img src="${pageContext.request.contextPath}/img/lcb/shibai.jpg"><p id="p1"></p></div>
<div class="wechat_bot" id="wechat_bot"><a onClick="apply()">申请加入店铺</a></div>

<div class="clear"></div>
<div class="bot"><img src="${pageContext.request.contextPath}/img/lcb/bot_tu.png"></div>
<div id="dlDiv" style="display:none;">
  <div class="show">
    <div class="show_top" id="show_top"><span id="show_top_span">请输入您的手机号:</span><br><br>
    	<input type="tel" name="tel" placeholder="请输入您的电话" class="input" id="tel" onkeyup="this.value=this.value.replace(/[^\d]/g,'') " onafterpaste="this.value=this.value.replace(/[^\d]/g,'')" maxlength="11">
    </div>
    <div class="show_bot">
     <div class="show_bot_left"><a onClick="Manual_close();">取消</a></div>
      <div class="show_bot_right" id="show_bot_right"><a onClick="tel()" >确定</a></div>
      <!--<div class="show_bot_centent"><a onClick="closeDiv();">知道了</a></div>-->
    </div>
    <div class="clear"></div>
  </div>
  <div id="overDiv" style="display:none;"></div>
</div>
</body>
</html>